#ifndef __BSP_EC800M_H
#define __BSP_EC800M_H	
#include "bsp_usart.h"
#include <stm32f10x.h>
#include "core_delay.h"
#include "Storage_Adapter.h"

// 定义默认的数据开头和结尾标记
#define DEFAULT_DATA_PREFIX "hellohello"
#define DEFAULT_DATA_SUFFIX "byebye"
#define DEFAULT_DATA_HEARTBEAT "heartbeat"

extern UART_BUF EC800M_BUF;     //4G

void Clear_Buffer(void);//清空缓存	
void EC800M_4G_Init(void);
void EC800M_UART_Init(void);
void CSTX_4G_PDPACT(void);
void CSTX_4G_ConTCP(void);
void CSTX_4G_CreateTCPSokcet(void);
void CSTX_4G_Senddata(uint8_t *len,uint8_t *data);
void CSTX_4G_SenddataWithPrefixSuffix(uint8_t *data, const char* prefix, const char* suffix);
void CSTX_4G_SendDHT11Data(DHT11_Storage_Data_TypeDef *dht11_data);//发送DHT11温湿度数据
void CSTX_4G_CreateSokcet(void);
void Clear_Buffer(void);
void CSTX_4G_ChecekConStatus(void);
void CSTX_4G_RECTCPData(void);
typedef struct
{
    uint8_t CSQ;    
    uint8_t Socketnum;  //编号
    uint8_t reclen;  //获取到数据的长度
    uint8_t res;      
    uint8_t recdatalen[10];
    uint8_t recdata[100];
    uint8_t netstatus;//网络指示灯
} CSTX_4G;

void EC800M_UART_send_byte(char data);
void EC800M_UART_SendStr(char*SendBuf);

#endif







